"""
@-*- coding: utf-8 -*-
@ python: 3.12.3
@ 创建者: JacksonCode
@ 创建时间: 2025-09-24
"""
import json
import time

import requests

headers = {
    "Content-Type": "application/json;charset=UTF-8"
}
url = "http://localhost:18104/PayWithWallet/checkOrder"
data = {
    "orderId": "1758700663596-969-271",
    "orderNo": "24242509247827523960586"
}
json_data = json.dumps(data)
response = requests.post(url, headers=headers, data=json_data)

# print(response.json())
# print(response)

json_result = response.json()
# print(type(json_result))  # dict
print(json_result.get("data").get("orderStatus"))
n = 0
while (json_result.get("data").get("orderStatus") == 1):
    time.sleep(1)
    print(f"第{n}次请求,result = {json_result}")
    n += 1
    response = requests.post(url, headers=headers, data=json_data)
    json_result = response.json()
